--require "Battle/Manager/FightDamageManager"

BuffEffect12 = BaseBuffEffect:new();
BuffEffect12.__index = BuffEffect12;

function BuffEffect12:new()
    local object = {};
    setmetatable(object, BuffEffect12);
    return object;
end

function BuffEffect12:action(fight,buff,...)
    local target = buff.target;
    local fighter = buff.source;
    
    -- 瞬移
    local leftOrRight = FightDamageManager.leftOrRight1(target, fighter);
    local buffValue = decodeJsonStrToTabel(buff.buffBean.f_BuffEffectValue);
    fighter.position.x = target.position.x + leftOrRight * buffValue[1] / EnumConst.TEN_THOUSANDTH;
    fighter.position.y = target.position.y;
    local oldPos = target:getPosition();
    fighter:setPosition(Vector3(fighter.position.x,oldPos.y,fighter.position.y));
    checkOut(fighter, EnumConst.FIGHT_INNER_ROUND);
    fightLog("[EFFECT]Fighter "..fighter.fighterId.." Buff"..buff.modelId.." 瞬移效果，坐标改变为："..printVector2(fighter.position.x,fighter.position.y));

    return BaseBuffEffect:action(fight, buff,...);
end